package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 故我
 * Date: 2023-05-08
 * Time: 13:33
 */
abstract class Shape {
    //abstract final void drow();//不能被修饰
    //abstract static void fly();//不能被修饰


    abstract public void draw();//抽象方法可以不用实现

    public final double area = 12.1;

    public double area() {
        return area;
    }

//    public Shape(double area) {
//        this.area = area;
//    }

    //abstract private void fly();//abstract 不能修饰私有  就是为了被继承
}

class Rect extends Shape {
    /*public Rect(double area) {
        super(area);
    }*/

    @Override
    public void draw() {
        System.out.println("矩形!");
    }

}

class Circle extends Shape{

   /* public Circle(double area) {
        super(area);
    }*/
    @Override
    public void draw() {
        System.out.println("⚪!");
    }
}

public class Testdemo1 {
    public static void DrowMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        //Shape shape = new Shape();
        Rect rect = new Rect();
        Circle circle = new Circle();

        DrowMap(rect);
        DrowMap(circle);
    }
}
